package com.cll.pmis.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.cll.pmis.entity.Dossier;
import com.cll.pmis.mapper.DossierMapper;
import com.cll.pmis.service.IDossierService;
import com.cll.pmis.service.IOrderService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author chenliangliang
 * @since 2018-06-18
 */
@Service
public class DossierServiceImpl extends ServiceImpl<DossierMapper, Dossier> implements IDossierService {

    private IOrderService orderService;

    protected DossierServiceImpl(IOrderService orderService){
        this.orderService=orderService;
    }

    @Override
    public List<Dossier> queryInfo(String username, Integer did) {

        return this.baseMapper.selectList(new EntityWrapper<Dossier>()
                .eq(did != null, "id", did)
                .like(StringUtils.isNotBlank(username), "username", username));
    }

    @Override
    public DossierMapper getMapper() {
        return this.baseMapper;
    }

}
